﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NodeBasedSkillEditor.Model.Node.RT
{
    public class Node_IntegerToBoolean_RT : RT_Node
    {
        public RT_SingleValuePort In_Integer;

        public RT_SingleValuePort Out_Boolean;

        public Node_IntegerToBoolean_RT(Node_IntegerToBoolean sourceData, RT_DAG parentDag) : base(sourceData, parentDag)
        {
            In_Integer = new RT_SingleValuePort(EPortIOType.Input, sourceData.Integer, this);

            Out_Boolean = new RT_SingleValuePort(EPortIOType.Output, sourceData.Boolean, this);
            Out_Boolean.OnGetValue = GetOutBoolean;
        }

        public AValue GetOutBoolean(DAG_Executor executor)
        {
            var intValue = In_Integer.GetValue(executor) as Value_Integer;
            Out_Boolean.SourceValue.SetInteger(intValue.Value);
            return Out_Boolean.SourceValue;
        }
    }
}
